// router/guard.js（路由守卫）
router.beforeEach((to, from, next) => {
    const userRole = store.state.auth.role;
    if (to.meta.role && userRole !== to.meta.role) {
      next('/login'); // 权限不符跳转登录页
    } else {
      next();
    }
  });